package com.lin.socketio.event;

import com.corundumstudio.socketio.AckRequest;
import com.corundumstudio.socketio.SocketIOClient;
import com.lin.common.error.CustomRuntimeException;
import com.lin.config.SpringContextIniter;
import com.lin.socketio.dto.ChatObject;
import com.lin.po.Customer;

import java.io.UnsupportedEncodingException;

public interface SocketHandler {

    void connect(SocketIOClient client, Customer c);

    void event(SocketIOClient client, ChatObject data, AckRequest ackSender) throws CustomRuntimeException, UnsupportedEncodingException;

    void disconnect(SocketIOClient client);

    static SocketHandler getBean(String beanName){
        return SpringContextIniter.getBean(beanName,SocketHandler.class);
    }
}
